package com.youi.shop.pojo.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 * 购物车表
 * </p>
 *
 * @author xxf
 * @since 2020-11-09
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("tb_cart")
@ApiModel(value="Cart对象", description="购物车表")
public class Cart implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "购物车主键")
    @TableId(value = "cart_id", type = IdType.AUTO)
    private Long cartId;

    @ApiModelProperty(value = "会员表主键")
    @TableField("member_id")
    private Long memberId;

    @ApiModelProperty(value = "商品表主键")
    @TableField("product_id")
    private Long productId;

    @ApiModelProperty(value = "购买数量")
    @TableField("quantity")
    private Integer quantity;

    @ApiModelProperty(value = "购物车总金额")
    @TableField("total_amount")
    private BigDecimal totalAmount;

    @ApiModelProperty(value = "创建时间")
    @TableField("create_time")
    private Date createTime;

    @ApiModelProperty(value = "更新时间")
    @TableField("update_time")
    private Date updateTime;

    @TableLogic
    @ApiModelProperty(value = "默认未删除，0-->未删除；1-->已删除")
    @TableField("delete_status")
    private Integer deleteStatus;

    @TableField(exist = false)
    private Product product;

}
